package com.ouc.eddyAlgorithm.dao;


import com.ouc.eddyAlgorithm.domain.VgEddy;
import com.ouc.eddyAlgorithm.entity.VGGridData;
import ucar.ma2.InvalidRangeException;
import ucar.nc2.NetcdfFile;

import java.io.IOException;
import java.text.ParseException;
import java.util.List;

public interface VGDao {
  /**
   * 获取涡旋格网
   *
   * @param file        nc文件
   * @param a
   * @param b
   * @param level
   * @param constraints
   * @param lon
   * @param lat
   * @return
   * @throws IOException
   * @throws InvalidRangeException
   */
  VGGridData getVGGridData(NetcdfFile file, int a, int b, int level, boolean[] constraints, Float[] lon, Float[] lat) throws IOException, InvalidRangeException;

  List<VgEddy> getVgEddyMatrix(NetcdfFile file, int a, int b, int level, boolean[] constraints, int eddyStartId) throws IOException, InvalidRangeException;

  /**
   * 获取一层的vg涡旋
   *
   * @param file        nc文件
   * @param a           限制条件
   * @param b           限制条件
   * @param constraints 约束条件
   * @param k           层级
   * @param eddyStartId 涡旋开始id
   * @return
   * @throws IOException
   * @throws InvalidRangeException
   */
  List<VgEddy> getVgEddyMatrixAll(NetcdfFile file, int a, int b, boolean[] constraints, int k, int eddyStartId) throws IOException, InvalidRangeException, ParseException;

  /**
   * 获取范围层级内的所有vg涡旋点
   *
   * @param file        nc文件
   * @param a           限制条件
   * @param b           限制条件
   * @param constraints 约束条件
   * @param levels      层级
   * @param eddyStartId 涡旋id
   * @param lonLimit    经度限制条件
   * @param latLimit    纬度限制条件
   * @return
   * @throws IOException
   * @throws InvalidRangeException
   */
  List<List<VgEddy>> getVgEddyMatrixWithLimitLevel(NetcdfFile file, int a, int b, boolean[] constraints, Float[] lonLimit, Float[] latLimit, Integer[] levels, int eddyStartId) throws IOException, InvalidRangeException;

  float[][] getSurfaceData(NetcdfFile file, String variableName, int level) throws IOException, InvalidRangeException;
}
